package springboot.config;

import springboot.annotation.MyConditionalOnClass;
import springboot.http.MyJettyServer;
import springboot.http.MyTomcatServer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 自定义服务端自动配置类
 */
@Configuration
public class MyWebServerAutoConfiguration {
    @Bean
    @MyConditionalOnClass("org.eclipse.jetty.server.Server")
    public MyJettyServer jettyServer() {
        return new MyJettyServer();
    }

    @Bean
    @MyConditionalOnClass("org.apache.catalina.startup.Tomcat")
    public MyTomcatServer tomcatServer() {
        return new MyTomcatServer();
    }
}